<%--
 *  File:    ProductSelect4MultiCollate.jsp
 *  @Author: AlexLi
 *  Date:    11/19/2003
 *  @Modifier: Jamesli
 *  Date:    07/28/2010
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only spc] skipping /oval/in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%
  //init param
  String privilegeCode = "ALL";
  String strTableName = "ovproductsummary";
  String strModuleName = "COM";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>

</head>
<body>
<html>
<head>
<title>ProductSelect4MultiCollate</title>
<PageFlow:CheckPageFlow pageName="p_proudctsummary"/>
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/SumDiv.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/PopWindow.js"></script>
<script language="JavaScript">

function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "ProductSelect4MultiCollate.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}
function page_add()
{
  var id =  document.cform.prodid.value;
  var umcode = document.cform.umcode.value;
  var prodcode = document.cform.prodcode.value;
  var prodname = document.cform.prodname.value;
  var catn = document.cform.catn.value;
  if(id == null || id.length == 0 || id == "" || id == "-1")
  {
     alert("<%= message.getMessageDesc("PLEASE_SELECT") %>");
     return;
  }
  opener.page_setmulticollate(id,umcode,prodcode,prodname,cform.returnvalue.value);
  window.close();
}
function clickRow(obj,idx)
{
  var cform = document.cform;
  cform.radiorow[idx].checked=true;
  cform.prodid.value = eval('obj.all.prodid'+idx).value;
  cform.prodcode.value = eval('obj.all.prodcode'+idx).value;
  cform.umcode.value = eval('obj.all.umcode'+idx).value;
  cform.prodname.value=   eval('obj.all.prodname'+idx).value;
  cform.catn.value=   eval('obj.all.catn'+idx).value;
}

</script>
</head>
<body>

<% //--------------------------------------  hidden form variant --%>
<form name="cform" method="post" action="../Dispatcher"  target="_self">
<input type="hidden" name="pagename" value="p_proudctsummary">
<input type="hidden" name="actionname">
<input type="hidden" name="returnvalue" value="<%=request.getParameter("returnvalue") %>">
<%--  page location   --%>
    <%@ include file="/inc/PageLocation.inc" %>

    <table width="100%" cellspacing="0" border="0" cellpadding="0">
      <tr>
      <%--  search criteria  --%>
      </tr>
      <tr>
        <td>
          <table width="100%" border="0" cellspacing="0">
            <%@ include file="/inc/SummarySearch.inc" %>
          </table>
        </td>
      </tr>
        <tr>
    <td>
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0">
        <form>

<%
    ArrayList titleTdArray = new ArrayList();
    titleTdArray.add(new TD("22","&nbsp;"));
    titleTdArray.add(new TitleTD("80","L_Code","prodcode"));
    titleTdArray.add(new TitleTD("80","L_Name","prodname"));
    titleTdArray.add(new TitleTD("80","L_Umname","umcode"));
    titleTdArray.add(new TitleTD("80","L_ProdCategoryCode","catn"));
%>
    <custom:titletr styleClass="deepblue-left" tdArray="<%=titleTdArray%>" />
          <%
		        Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
		        if(totalsummary == null) totalsummary = new Vector();
		  %>

  <%
      ArrayList detailTdArray = new ArrayList();
     detailTdArray.add(new RadioTD());
     detailTdArray.add(new WriteTD("prodcode"));
     detailTdArray.add(new WriteTD("prodname"));
     detailTdArray.add(new WriteTD("umcode"));
     detailTdArray.add(new WriteTD("catn"));


	 //form hidden elements
     ArrayList hiddenArray = new ArrayList();
     hiddenArray.add(new HiddenInput("prodid",true));
     hiddenArray.add(new HiddenInput("prodcode",true));
     hiddenArray.add(new HiddenInput("prodname",true));
     hiddenArray.add(new HiddenInput("umcode",true));
     hiddenArray.add(new HiddenInput("catn",true));
      %>
        <custom:iteratetr tdArray="<%=detailTdArray%>" hiddenArray="<%=hiddenArray%>"  dataSource="totalsummary"/>
		<%@include file="/inc/SummaryAction.inc" %>

        </form>
      </table>
      <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td class="summary_top"></td>
        </tr>
        <tr>
          <td class="td_center">
          <a onclick="page_add();"><custom:button type="1" label="L_Save" imgsrc="add.gif" border="0" style="width:60"/></a></td>
        </tr>
      </table>
    </td>
  </tr>

</table>
</form>
</body>
</html>








